package cn.yitun.chat.yitunservercommonlib.converter.ot;

import cn.yitun.chat.yitunservercommonlib.dataentity.vo.system.MenuTreeTableVo;
import cn.yitun.chat.yitunservercommonlib.dataentity.vo.system.MenuVo;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(componentModel = "spring")
public interface TreeMenuConverter {

    TreeMenuConverter INSTANCE = Mappers.getMapper(TreeMenuConverter.class);
//    @Mappings({
//            @Mapping(source = "parentId" ,target = "parentId" ),
//            @Mapping(source = "parentUrl" ,target = "parentUrl" ),
//            @Mapping(source = "parentName" ,target = "parentName" ),
//    })
    MenuTreeTableVo vo2treevo(MenuVo dto);

    List<MenuTreeTableVo> vo2treevo(List<MenuVo> dtoList);

    @InheritInverseConfiguration
    MenuVo treevo2vo(MenuTreeTableVo dto);
    @InheritInverseConfiguration
    List<MenuVo> treevo2vo(List<MenuTreeTableVo> dtoList);
}
